﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Liger.Web.Common;
using Liger.Web.Common.Extensions;

namespace Liger.Web.UI
{
    public class AccordionBuilder : UIComponentBuilderBase, IHideObjectMembers
    {
        private Accordion Accordion
        {
            get
            {
                return this.Component as Accordion;
            }
        }


        public AccordionBuilder()
            : base(new Accordion())
        {

        }

        public AccordionBuilder(Accordion Accordion)
            : base(Accordion)
        {

        }

        /// <summary>
        /// 设置属性
        /// </summary>
        /// <param name="property"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public AccordionBuilder Set(string property, object value)
        {
            if (this.Accordion.Properties.ContainsKey(property))
            {
                this.Accordion.Properties[property] = value;
            }
            else
            {
                this.Accordion.Properties.Add(property, value);
            }
            return this;
        }

        /// <summary>
        /// 返回ligerAccordion的Manager
        /// </summary>
        /// <param name="manager">manager的对象名</param>
        /// <returns></returns>
        public AccordionBuilder Manager(string manager)
        {
            this.Accordion.Manager = manager;
            return this;
        }


        public AccordionBuilder Height(string value)
        {
            this.Accordion.Height = value;
            return this;
        }
        public AccordionBuilder Speed(string value)
        {
            this.Accordion.Speed = value;
            return this;
        }
        public AccordionBuilder ChangeHeightOnResize(bool value)
        {
            this.Accordion.ChangeHeightOnResize = value;
            return this;
        }
        public AccordionBuilder HeightDiff(int value)
        {
            this.Accordion.HeightDiff = value;
            return this;
        }
    }
}